package action.common;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import dao.common.StockPlanDao;
import model.common.StockPlan;

public class StockPlanAction {
  
	private StockPlan sp;
	
	public void add(StockPlan sp) throws Exception{
		StockPlanDao dao =new StockPlanDao();
		dao.addStockPlan(sp);
		
	}
	
	public void get(Integer goodsStockId) throws Exception{
		StockPlanDao dao =new StockPlanDao();
		dao.get(goodsStockId);
	}
	
	public void edit(StockPlan sp) throws SQLException{
		
		StockPlanDao dao =new StockPlanDao();
		dao.updateStockPlan(sp);
	}
	
	public void del(Integer goodsStockId) throws SQLException{

		StockPlanDao dao =new StockPlanDao();
		dao.deleteStockPlan(goodsStockId);
	}
	
	public List<StockPlan> query(List<Map<String, Object>> params) throws Exception{
		StockPlanDao dao =new StockPlanDao();
		return dao.query(params);
		
	}
	
	public List<StockPlan> query(String goodsName,String goodsPrice) throws Exception{
		StockPlanDao dao =new StockPlanDao();
		return dao.query(goodsName, goodsPrice);
		
	}
}
